$(document).ready(function () {
  // 在这里写你的代码...
  init();
});
// 初始化
function init() {
  $.ajax({
    type: "get",
    url: server + "/daping-gw/getdata.do",
    // data: "name=John&location=Boston",
    success: function (msg) {
      // console.log("Data Saved: " + msg);
      // 头部
      var dataArr = $.parseJSON(msg).header;
      $("#xuetangHeaderId").text(dataArr.xietang);
      $("#jiankangzhidaoHeaderId").text(dataArr.jiankang);
      $("#zhongyitizhiHeaderId").text(dataArr.zhongyitz);
      $("#zhongyifuwuHeaderId").text(dataArr.zhongyi);
      $("#bchaofuwuHeaderId").text(dataArr.bchao);
      $("#suifangfuwuHeaderId").text(dataArr.jiating);
      $("#tangniaobingfuwuHeaderId").text(dataArr.tangniao);
      // 档案覆盖率
      var danganArr = $.parseJSON(msg).dafg;
      // console.log(danganArr);
      danganfugailvFun(danganArr);
      // 体检完成率
      var tijianwanchenglvArr = $.parseJSON(msg).tj;
      tijianwanchenglvFun(tijianwanchenglvArr);
      //重点人群
      var zhongdianrenqunJsbArr = $.parseJSON(msg).zdrqJsb; //精神病
      var zhongdianrenqunGxyArr = $.parseJSON(msg).zdrqGxy; //高血压
      var zhongdianrenqunTnbArr = $.parseJSON(msg).zdrqTnb; //糖尿病
      zhongdianrenqunJsbFun(zhongdianrenqunJsbArr);
      zdrqtbxxkFun(zhongdianrenqunGxyArr, zhongdianrenqunTnbArr); //重点人群选项卡
      // 各乡镇签约统计分析
      var zqyrsNumber = $.parseJSON(msg).zqyrs; //总签约人数
      var zqylNumber = $.parseJSON(msg).zqyl; //总签约率
      $("#zongqianyuerenshuBg").text(zqyrsNumber);
      $("#zongqianyuelvBg").text(zqylNumber);
      var qianyueArr = $.parseJSON(msg).qianyue;
      zongqianyuerenshuCircleFun(qianyueArr); //各乡镇签约统计分析--总签约人数
      // zongqianyuelvCircleFun(); //各乡镇签约统计分析--总签约率
      villagesAndTownsSigningFun(); //切换表
      //老年人随访
      var laonianrenArr = $.parseJSON(msg).lnrsf;
      laonianrensuifangFun(laonianrenArr);

      // 高血压随访
      var gaoxueyaArr = $.parseJSON(msg).gxysf;
      gaoxueyasuifangFun(gaoxueyaArr);
      // 糖尿病随访
      var tangniaobingArr = $.parseJSON(msg).tnbsf;
      tangniaobingFun(tangniaobingArr);
    },
  });
}
//返回上一页
function retrunPage() {
  goprevPage();
}
// 各乡镇签约统计分析--总签约人数排名
function zongqianyuerenshuCircleFun(qianyueArr) {
  // console.log(qianyueArr);
  // 初始化
  var myChart = echarts.init(
    document.getElementById("villagesAndTownsSigningId")
  );
  var qianyuetextA = qianyueArr[0].street;
  var qianyueNumA = qianyueArr[0].numbers;
  var qianyuetextB = qianyueArr[1].street;
  var qianyueNumB = qianyueArr[1].numbers;
  var qianyuetextC = qianyueArr[2].street;
  var qianyueNumC = qianyueArr[2].numbers;
  var qianyuetextD = qianyueArr[3].street;
  var qianyueNumD = qianyueArr[3].numbers;
  var qianyuetextE = qianyueArr[4].street;
  var qianyueNumE = qianyueArr[4].numbers;
  var qianyuetextF = qianyueArr[5].street;
  var qianyueNumF = qianyueArr[5].numbers;
  var qianyuetextG = qianyueArr[6].street;
  var qianyueNumG = qianyueArr[6].numbers;
  var qianyuetextH = qianyueArr[7].street;
  var qianyueNumH = qianyueArr[7].numbers;
  var qianyuetextI = qianyueArr[8].street;
  var qianyueNumI = qianyueArr[8].numbers;
  var qianyuetextJ = qianyueArr[9].street;
  var qianyueNumJ = qianyueArr[9].numbers;
  var qianyuetextK = qianyueArr[10].street;
  var qianyueNumK = qianyueArr[10].numbers;
  var qianyuetextL = qianyueArr[11].street;
  var qianyueNumKL = qianyueArr[11].numbers;
  // console.log(qianyueNumKL);

  var myColor = [
    "#1089E7",
    "#F57474",
    "#56D0E3",
    "#F8B448",
    "#8B78F6",
    "#1089E7",
    "#F57474",
    "#56D0E3",
    "#F8B448",
    "#8B78F6",
  ];
  option = {
    // tooltip: {
    //   trigger: "axis",
    //   axisPointer: {
    //     type: "shadow",
    //   },
    // },

    grid: {
      left: "25%",
      right: "20%",
      bottom: "5%",
      top: 0,
      containLabel: false,
    },
    // 不显示x轴信息
    xAxis: {
      show: false,
    },
    // 不显示y轴线和相关刻度
    yAxis: [
      {
        type: "category",
        inverse: true,
        data: [
          qianyuetextA,
          qianyuetextB,
          qianyuetextC,
          qianyuetextD,
          qianyuetextE,
          qianyuetextF,
          qianyuetextG,
          qianyuetextH,
          qianyuetextI,
          qianyuetextJ,
          qianyuetextK,
          qianyuetextL,
        ],
        axisLine: {
          show: false,
        },
        axisTick: {
          show: false,
        },
        axisLabel: {
          color: "#fff",
          fontSize: 10,
        },
      },
      {
        type: "category",
        inverse: true,
        data: [
          qianyueNumA,
          qianyueNumB,
          qianyueNumC,
          qianyueNumD,
          qianyueNumE,
          qianyueNumF,
          qianyueNumG,
          qianyueNumH,
          qianyueNumI,
          qianyueNumJ,
          qianyueNumK,
          qianyueNumKL,
        ],
        axisLine: {
          show: false,
        },
        axisTick: {
          show: false,
        },
        axisLabel: {
          color: "#fff",
          fontSize: 10,
        },
      },
    ],
    series: [
      {
        name: "条",
        type: "bar",
        barCategoryGap: 20,
        barWidth: 7,
        yAxisIndex: 0,
        itemStyle: {
          barBorderRadius: 20,
          color: function (params) {
            // console.log(params);
            return myColor[params.dataIndex];
          },
        },
        data: [
          qianyueNumA,
          qianyueNumB,
          qianyueNumC,
          qianyueNumD,
          qianyueNumE,
          qianyueNumF,
          qianyueNumG,
          qianyueNumH,
          qianyueNumI,
          qianyueNumJ,
          qianyueNumK,
          qianyueNumKL,
        ],
      },
      {
        name: "框",
        type: "bar",
        barCategoryGap: 20,
        barWidth: 12,
        yAxisIndex: 1,
        itemStyle: {
          color: "none",
          borderColor: "#00c1de",
          borderWidth: 3,
          barBorderRadius: 15,
        },
        data: [
          100000,
          100000,
          100000,
          100000,
          100000,
          100000,
          100000,
          100000,
          100000,
          100000,
          100000,
          100000,
        ],
      },
    ],
  };

  myChart.setOption(option);
  window.addEventListener("resize", function () {
    myChart.resize();
  });

  //配置
}
//各乡镇签约统计分析--总签约率排名
function zongqianyuelvCircleFun() {
  // 初始化
  // var myChart = echarts.init(document.getElementById("zongqianyuelvId"));
  //配置
}
// 各乡镇签约统计分析
function villagesAndTownsSigningFun() {
  // 点击切换 人数和率
  $("#zongqianyuerenshuSelectId").click(function () {
    // console.log(1111);
    // $("#villagesAndTownsSigningId").show();
    // $("#zongqianyuelvId").hide();
    $(this).children().css("color", "#0cf0ff");
    $("#zongqianyuelvSelectId").children().css("color", "#fff");
  });
  $("#zongqianyuelvSelectId").click(function () {
    // console.log(2222);
    // $("#villagesAndTownsSigningId").hide();
    // $("#zongqianyuelvId").show();
    $(this).children().css("color", "#0cf0ff");
    $("#zongqianyuerenshuSelectId").children().css("color", "#fff");
  });
}

//档案覆盖率
function danganfugailvFun(danganArr) {
  // console.log(danganArr);
  var xiangNameA = danganArr[0].street;
  var xiangNumberA = danganArr[0].numbers;
  var xiangNameB = danganArr[1].street;
  var xiangNumberB = danganArr[1].numbers;
  var xiangNameC = danganArr[2].street;
  var xiangNumberC = danganArr[2].numbers;
  var xiangNameD = danganArr[3].street;
  var xiangNumberD = danganArr[3].numbers;
  var xiangNameE = danganArr[4].street;
  var xiangNumberE = danganArr[4].numbers;
  var xiangNameF = danganArr[5].street;
  var xiangNumberF = danganArr[5].numbers;
  var xiangNameG = danganArr[6].street;
  var xiangNumberG = danganArr[6].numbers;
  var xiangNameH = danganArr[7].street;
  var xiangNumberH = danganArr[7].numbers;
  var xiangNameI = danganArr[8].street;
  var xiangNumberI = danganArr[8].numbers;
  var xiangNameJ = danganArr[9].street;
  var xiangNumberJ = danganArr[9].numbers;
  var xiangNameK = danganArr[10].street;
  var xiangNumberK = danganArr[10].numbers;
  var xiangNameL = danganArr[11].street;
  var xiangNumberL = danganArr[11].numbers;
  // 初始化
  var myChart = echarts.init(document.getElementById("danganfugailvId"));
  option = {
    series: [
      {
        name: "档案覆盖率",
        type: "pie",
        radius: "55%",
        center: ["50%", "50%"],

        data: [
          {
            value: xiangNumberA,
            name: xiangNameA,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: xiangNumberB,
            name: xiangNameB,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: xiangNumberC,
            name: xiangNameC,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: xiangNumberD,
            name: xiangNameD,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: xiangNumberE,
            name: xiangNameE,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: xiangNumberF,
            name: xiangNameF,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: xiangNumberG,
            name: xiangNameG,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: xiangNumberH,
            name: xiangNameH,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: xiangNumberI,
            name: xiangNameI,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: xiangNumberJ,
            name: xiangNameJ,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: xiangNumberK,
            name: xiangNameK,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: xiangNumberL,
            name: xiangNameL,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
        ],
        emphasis: {
          itemStyle: {
            shadowBlur: 10,
            shadowOffsetX: 0,
            shadowColor: "rgba(0, 0, 0, 0.5)",
          },
        },
      },
    ],
  };
  myChart.setOption(option);
  window.addEventListener("resize", function () {
    myChart.resize();
  });
}

// 老年人随访
function laonianrensuifangFun(laonianrenArr) {
  var itemsTextA = laonianrenArr[0].street;
  var itemsNumA = laonianrenArr[0].numbers;
  var itemsTextB = laonianrenArr[1].street;
  var itemsNumB = laonianrenArr[1].numbers;
  var itemsTextC = laonianrenArr[2].street;
  var itemsNumC = laonianrenArr[2].numbers;
  var itemsTextD = laonianrenArr[3].street;
  var itemsNumD = laonianrenArr[3].numbers;
  // var itemsTextE = laonianrenArr[4].street;
  // var itemsNumE = laonianrenArr[4].numbers;
  var myColor = [
    "#1089E7",
    "#F57474",
    "#56D0E3",
    "#F8B448",
    "#8B78F6",
    "#1089E7",
    "#F57474",
    "#56D0E3",
    "#F8B448",
    "#8B78F6",
  ];
  // 初始化
  var myChart = echarts.init(document.getElementById("laoniansuifangId"));
  option = {
    // tooltip: {
    //   trigger: "axis",
    //   axisPointer: {
    //     type: "shadow",
    //   },
    // },

    grid: {
      left: "20%",
      right: "20%",
      bottom: "5%",
      top: "10%",
      containLabel: false,
    },
    // 不显示x轴信息
    xAxis: {
      show: false,
    },
    // 不显示y轴线和相关刻度
    yAxis: [
      {
        type: "category",
        inverse: true,
        data: [itemsTextA, itemsTextB, itemsTextC, itemsTextD],
        axisLine: {
          show: false,
        },
        axisTick: {
          show: false,
        },
        axisLabel: {
          color: "#fff",
          fontSize: 10,
        },
      },
      {
        type: "category",
        inverse: true,
        data: [itemsNumA, itemsNumB, itemsNumC, itemsNumD],
        axisLine: {
          show: false,
        },
        axisTick: {
          show: false,
        },
        axisLabel: {
          color: "#fff",
          fontSize: 10,
        },
      },
    ],
    series: [
      {
        name: "条",
        type: "bar",
        barCategoryGap: 10,
        barWidth: 7,
        yAxisIndex: 0,
        itemStyle: {
          barBorderRadius: 20,
          color: function (params) {
            // console.log(params);
            return myColor[params.dataIndex];
          },
        },
        data: [itemsNumA, itemsNumB, itemsNumC, itemsNumD],
      },
      {
        name: "框",
        type: "bar",
        barCategoryGap: 10,
        barWidth: 12,
        yAxisIndex: 1,
        itemStyle: {
          color: "none",
          borderColor: "#00c1de",
          borderWidth: 3,
          barBorderRadius: 15,
        },
        data: [500, 500, 500, 500, 500],
      },
    ],
  };

  myChart.setOption(option);
  window.addEventListener("resize", function () {
    myChart.resize();
  });
}
// 高血压随访
function gaoxueyasuifangFun(gaoxueyaArr) {
  var gxyTextA = gaoxueyaArr[0].street;
  var gxyNumberA = gaoxueyaArr[0].numbers;
  var gxyTextB = gaoxueyaArr[1].street;
  var gxyNumberB = gaoxueyaArr[1].numbers;
  var gxyTextC = gaoxueyaArr[2].street;
  var gxyNumberC = gaoxueyaArr[2].numbers;
  var gxyTextD = gaoxueyaArr[3].street;
  var gxyNumberD = gaoxueyaArr[3].numbers;
  var gxyTextE = gaoxueyaArr[4].street;
  var gxyNumberE = gaoxueyaArr[4].numbers;
  var gxyTextF = gaoxueyaArr[5].street;
  var gxyNumberF = gaoxueyaArr[5].numbers;
  var gxyTextG = gaoxueyaArr[6].street;
  var gxyNumberG = gaoxueyaArr[6].numbers;
  var gxyTextH = gaoxueyaArr[7].street;
  var gxyNumberH = gaoxueyaArr[7].numbers;
  var gxyTextI = gaoxueyaArr[8].street;
  var gxyNumberI = gaoxueyaArr[8].numbers;
  var gxyTextJ = gaoxueyaArr[9].street;
  var gxyNumberJ = gaoxueyaArr[9].numbers;
  var gxyTextJ = gaoxueyaArr[10].street;
  var gxyNumberJ = gaoxueyaArr[10].numbers;
  // var gxyTextK = gaoxueyaArr[11].street;
  // var gxyNumberK = gaoxueyaArr[11].numbers;
  var myColor = [
    "#1089E7",
    "#F57474",
    "#56D0E3",
    "#F8B448",
    "#8B78F6",
    "#1089E7",
    "#F57474",
    "#56D0E3",
    "#F8B448",
    "#8B78F6",
  ];
  // 初始化
  var myChart = echarts.init(document.getElementById("gaoxueyaId"));
  option = {
    // tooltip: {
    //   trigger: "axis",
    //   axisPointer: {
    //     type: "shadow",
    //   },
    // },

    grid: {
      left: "20%",
      right: "20%",
      bottom: "5%",
      top: "10%",
      containLabel: false,
    },
    // 不显示x轴信息
    xAxis: {
      show: false,
    },
    // 不显示y轴线和相关刻度
    yAxis: [
      {
        type: "category",
        inverse: true,
        data: [
          gxyTextA,
          gxyTextB,
          gxyTextC,
          gxyTextD,
          gxyTextE,
          gxyTextF,
          gxyTextG,
          gxyTextH,
          gxyTextI,
          gxyTextJ,
        ],
        axisLine: {
          show: false,
        },
        axisTick: {
          show: false,
        },
        axisLabel: {
          color: "#fff",
          fontSize: 10,
        },
      },
      {
        type: "category",
        inverse: true,
        data: [
          gxyNumberA,
          gxyNumberB,
          gxyNumberC,
          gxyNumberD,
          gxyNumberE,
          gxyNumberF,
          gxyNumberG,
          gxyNumberH,
          gxyNumberI,
          gxyNumberJ,
        ],
        axisLine: {
          show: false,
        },
        axisTick: {
          show: false,
        },
        axisLabel: {
          color: "#fff",
          fontSize: 10,
        },
      },
    ],
    series: [
      {
        name: "条",
        type: "bar",
        barCategoryGap: 10,
        barWidth: 7,
        yAxisIndex: 0,
        itemStyle: {
          barBorderRadius: 20,
          color: function (params) {
            // console.log(params);
            return myColor[params.dataIndex];
          },
        },
        data: [
          gxyNumberA,
          gxyNumberB,
          gxyNumberC,
          gxyNumberD,
          gxyNumberE,
          gxyNumberF,
          gxyNumberG,
          gxyNumberH,
          gxyNumberI,
          gxyNumberJ,
        ],
      },
      {
        name: "框",
        type: "bar",
        barCategoryGap: 10,
        barWidth: 12,
        yAxisIndex: 1,
        itemStyle: {
          color: "none",
          borderColor: "#00c1de",
          borderWidth: 3,
          barBorderRadius: 15,
        },
        data: [
          200000,
          200000,
          200000,
          200000,
          200000,
          200000,
          200000,
          200000,
          200000,
          200000,
        ],
      },
    ],
  };

  myChart.setOption(option);
  window.addEventListener("resize", function () {
    myChart.resize();
  });
}
// 糖尿病
function tangniaobingFun(tangniaobingArr) {
  console.log(tangniaobingArr);
  var tnbTextA = tangniaobingArr[0].street;
  var tnbNumA = tangniaobingArr[0].numbers;
  var tnbTextB = tangniaobingArr[1].street;
  var tnbNumB = tangniaobingArr[1].numbers;
  var tnbTextC = tangniaobingArr[2].street;
  var tnbNumC = tangniaobingArr[2].numbers;
  var tnbTextD = tangniaobingArr[3].street;
  var tnbNumD = tangniaobingArr[3].numbers;
  var tnbTextE = tangniaobingArr[4].street;
  var tnbNumE = tangniaobingArr[4].numbers;
  var tnbTextF = tangniaobingArr[5].street;
  var tnbNumF = tangniaobingArr[5].numbers;
  var tnbTextG = tangniaobingArr[6].street;
  var tnbNumG = tangniaobingArr[6].numbers;
  var tnbTextH = tangniaobingArr[7].street;
  var tnbNumH = tangniaobingArr[7].numbers;
  var tnbTextI = tangniaobingArr[8].street;
  var tnbNumI = tangniaobingArr[8].numbers;
  var tnbTextJ = tangniaobingArr[9].street;
  var tnbNumJ = tangniaobingArr[9].numbers;
  var tnbTextK = tangniaobingArr[10].street;
  var tnbNumK = tangniaobingArr[10].numbers;
  var myChart = echarts.init(document.getElementById("tangniaobingId"));
  var myColor = [
    "#1089E7",
    "#F57474",
    "#56D0E3",
    "#F8B448",
    "#8B78F6",
    "#1089E7",
    "#F57474",
    "#56D0E3",
    "#F8B448",
    "#8B78F6",
  ];
  option = {
    // tooltip: {
    //   trigger: "axis",
    //   axisPointer: {
    //     type: "shadow",
    //   },
    // },

    grid: {
      left: "20%",
      right: "20%",
      bottom: "5%",
      top: "10%",
      containLabel: false,
    },
    // 不显示x轴信息
    xAxis: {
      show: false,
    },
    // 不显示y轴线和相关刻度
    yAxis: [
      {
        type: "category",
        inverse: true,
        data: [
          tnbTextA,
          tnbTextB,
          tnbTextC,
          tnbTextD,
          tnbTextE,
          tnbTextF,
          tnbTextG,
          tnbTextH,
          tnbTextI,
          tnbTextJ,
          tnbTextK,
        ],
        axisLine: {
          show: false,
        },
        axisTick: {
          show: false,
        },
        axisLabel: {
          color: "#fff",
          fontSize: 10,
        },
      },
      {
        type: "category",
        inverse: true,
        data: [
          tnbNumA,
          tnbNumB,
          tnbNumC,
          tnbNumD,
          tnbNumE,
          tnbNumF,
          tnbNumG,
          tnbNumH,
          tnbNumI,
          tnbNumJ,
          tnbNumK,
        ],
        axisLine: {
          show: false,
        },
        axisTick: {
          show: false,
        },
        axisLabel: {
          color: "#fff",
          fontSize: 10,
        },
      },
    ],
    series: [
      {
        name: "条",
        type: "bar",
        barCategoryGap: 10,
        barWidth: 7,
        yAxisIndex: 0,
        itemStyle: {
          barBorderRadius: 20,
          color: function (params) {
            // console.log(params);
            return myColor[params.dataIndex];
          },
        },
        data: [
          tnbNumA,
          tnbNumB,
          tnbNumC,
          tnbNumD,
          tnbNumE,
          tnbNumF,
          tnbNumG,
          tnbNumH,
          tnbNumI,
          tnbNumJ,
          tnbNumK,
        ],
      },
      {
        name: "框",
        type: "bar",
        barCategoryGap: 10,
        barWidth: 12,
        yAxisIndex: 1,
        itemStyle: {
          color: "none",
          borderColor: "#00c1de",
          borderWidth: 3,
          barBorderRadius: 15,
        },
        data: [
          10000,
          10000,
          10000,
          10000,
          10000,
          10000,
          10000,
          10000,
          10000,
          10000,
          10000,
        ],
      },
    ],
  };

  myChart.setOption(option);
  window.addEventListener("resize", function () {
    myChart.resize();
  });
}
//体检完成率
function tijianwanchenglvFun(tijianwanchenglvArr) {
  // console.log(tijianwanchenglvArr);
  var xiangNameA = tijianwanchenglvArr[0].street;
  var xiangNumberA = tijianwanchenglvArr[0].numbers;
  var xiangNameB = tijianwanchenglvArr[1].street;
  var xiangNumberB = tijianwanchenglvArr[1].numbers;
  var xiangNameC = tijianwanchenglvArr[2].street;
  var xiangNumberC = tijianwanchenglvArr[2].numbers;
  var xiangNameD = tijianwanchenglvArr[3].street;
  var xiangNumberD = tijianwanchenglvArr[3].numbers;
  var xiangNameE = tijianwanchenglvArr[4].street;
  var xiangNumberE = tijianwanchenglvArr[4].numbers;
  var xiangNameF = tijianwanchenglvArr[5].street;
  var xiangNumberF = tijianwanchenglvArr[5].numbers;
  var xiangNameG = tijianwanchenglvArr[6].street;
  var xiangNumberG = tijianwanchenglvArr[6].numbers;
  var xiangNameH = tijianwanchenglvArr[7].street;
  var xiangNumberH = tijianwanchenglvArr[7].numbers;
  var xiangNameI = tijianwanchenglvArr[8].street;
  var xiangNumberI = tijianwanchenglvArr[8].numbers;
  var xiangNameJ = tijianwanchenglvArr[9].street;
  var xiangNumberJ = tijianwanchenglvArr[9].numbers;
  var xiangNameK = tijianwanchenglvArr[10].street;
  var xiangNumberK = tijianwanchenglvArr[10].numbers;
  // 初始化
  var myChart = echarts.init(document.getElementById("tijianwanchenglvId"));
  option = {
    series: [
      {
        name: "体检完成率",
        type: "pie",
        radius: "55%",
        center: ["50%", "50%"],
        data: [
          {
            value: xiangNumberA,
            name: xiangNameA,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: xiangNumberB,
            name: xiangNameB,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: xiangNumberC,
            name: xiangNameC,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: xiangNumberD,
            name: xiangNameD,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: xiangNumberE,
            name: xiangNameE,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: xiangNumberF,
            name: xiangNameF,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: xiangNumberG,
            name: xiangNameG,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: xiangNumberH,
            name: xiangNameH,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: xiangNumberI,
            name: xiangNameI,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: xiangNumberJ,
            name: xiangNameJ,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: xiangNumberK,
            name: xiangNameK,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          // { value: xiangNumberL, name: xiangNameL },
        ],
        emphasis: {
          itemStyle: {
            shadowBlur: 10,
            shadowOffsetX: 0,
            shadowColor: "rgba(0, 0, 0, 0.5)",
          },
        },
      },
    ],
  };
  myChart.setOption(option);
  window.addEventListener("resize", function () {
    myChart.resize();
  });
}
// 重点人群头部选项卡
function zdrqtbxxkFun(zhongdianrenqunGxyArr, zhongdianrenqunTnbArr) {
  $("#jsbxxk").click(function () {
    $("#jsbtbBg").show();
    $("#gxytbBg").hide();
    $("#tnbtbBg").hide();
    $(this).css("color", "#0c8594");
    $("#gxyxxk").css("color", "#fff");
    $("#tnbxxk").css("color", "#fff");
  });
  $("#gxyxxk").click(function () {
    $("#jsbtbBg").hide();
    $("#gxytbBg").show();
    $("#tnbtbBg").hide();
    $(this).css("color", "#0c8594");
    $("#jsbxxk").css("color", "#fff");
    $("#tnbxxk").css("color", "#fff");
    zhongdianrenqunGxy(zhongdianrenqunGxyArr);
  });
  $("#tnbxxk").click(function () {
    $("#jsbtbBg").hide();
    $("#gxytbBg").hide();
    $("#tnbtbBg").show();
    $(this).css("color", "#0c8594");
    $("#gxyxxk").css("color", "#fff");
    $("#jsbxxk").css("color", "#fff");
    zhongdianrenqunTnb(zhongdianrenqunTnbArr);
  });
}
// 重点人群之精神病
function zhongdianrenqunJsbFun(zhongdianrenqunJsbArr) {
  // 精神病
  var jinshenbingTextA = zhongdianrenqunJsbArr[0].street;
  var jinshenbingnumberA = zhongdianrenqunJsbArr[0].numbers;
  var jinshenbingTextB = zhongdianrenqunJsbArr[1].street;
  var jinshenbingnumberB = zhongdianrenqunJsbArr[1].numbers;
  var jinshenbingTextC = zhongdianrenqunJsbArr[2].street;
  var jinshenbingnumberC = zhongdianrenqunJsbArr[2].numbers;
  var jinshenbingTextD = zhongdianrenqunJsbArr[3].street;
  var jinshenbingnumberD = zhongdianrenqunJsbArr[3].numbers;
  var jinshenbingTextE = zhongdianrenqunJsbArr[4].street;
  var jinshenbingnumberE = zhongdianrenqunJsbArr[4].numbers;
  var jinshenbingTextF = zhongdianrenqunJsbArr[5].street;
  var jinshenbingnumberF = zhongdianrenqunJsbArr[5].numbers;
  var jinshenbingTextG = zhongdianrenqunJsbArr[6].street;
  var jinshenbingnumberG = zhongdianrenqunJsbArr[6].numbers;
  var jinshenbingTextH = zhongdianrenqunJsbArr[7].street;
  var jinshenbingnumberH = zhongdianrenqunJsbArr[7].numbers;
  var jinshenbingTextI = zhongdianrenqunJsbArr[8].street;
  var jinshenbingnumberI = zhongdianrenqunJsbArr[8].numbers;
  var jinshenbingTextJ = zhongdianrenqunJsbArr[9].street;
  var jinshenbingnumberJ = zhongdianrenqunJsbArr[9].numbers;
  // var jinshenbingTextK = zhongdianrenqunJsbArr[10].street;
  // var jinshenbingnumberK = zhongdianrenqunJsbArr[10].numbers;

  var myChartJsb = echarts.init(document.getElementById("jsbtbBg"));

  optionJsb = {
    series: [
      {
        name: "精神病",
        type: "pie",
        radius: "50%",
        center: ["50%", "50%"],
        data: [
          {
            value: jinshenbingnumberA,
            name: jinshenbingTextA,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: jinshenbingnumberB,
            name: jinshenbingTextB,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: jinshenbingnumberC,
            name: jinshenbingTextC,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: jinshenbingnumberD,
            name: jinshenbingTextD,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: jinshenbingnumberE,
            name: jinshenbingTextE,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: jinshenbingnumberF,
            name: jinshenbingTextF,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: jinshenbingnumberG,
            name: jinshenbingTextG,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: jinshenbingnumberH,
            name: jinshenbingTextH,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: jinshenbingnumberI,
            name: jinshenbingTextI,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: jinshenbingnumberJ,
            name: jinshenbingTextJ,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          // { value: jinshenbingnumberK, name: jinshenbingTextK },
          // { value: xiangNumberL, name: xiangNameL },
        ],
        // label: {
        //   position: "outer",
        //   alignTo: "none",
        //   bleedMargin: 5,
        // },
        left: 0,
        right: 0,
        top: 0,
        bottom: 0,
      },
    ],
  };

  myChartJsb.setOption(optionJsb);

  window.addEventListener("resize", function () {
    myChartJsb.resize();
  });
}
//重点人群之高血压
function zhongdianrenqunGxy(zhongdianrenqunGxyArr) {
  console.log(zhongdianrenqunGxyArr);
  // 高血压
  var gxyTextA = zhongdianrenqunGxyArr[0].street;
  var gxynumberA = zhongdianrenqunGxyArr[0].numbers;
  var gxyTextB = zhongdianrenqunGxyArr[1].street;
  var gxynumberB = zhongdianrenqunGxyArr[1].numbers;
  var gxyTextC = zhongdianrenqunGxyArr[2].street;
  var gxynumberC = zhongdianrenqunGxyArr[2].numbers;
  var gxyTextD = zhongdianrenqunGxyArr[3].street;
  var gxynumberD = zhongdianrenqunGxyArr[3].numbers;
  var gxyTextE = zhongdianrenqunGxyArr[4].street;
  var gxynumberE = zhongdianrenqunGxyArr[4].numbers;
  var gxyTextF = zhongdianrenqunGxyArr[5].street;
  var gxynumberF = zhongdianrenqunGxyArr[5].numbers;
  var gxyTextG = zhongdianrenqunGxyArr[6].street;
  var gxynumberG = zhongdianrenqunGxyArr[6].numbers;
  var gxyTextH = zhongdianrenqunGxyArr[7].street;
  var gxynumberH = zhongdianrenqunGxyArr[7].numbers;
  var gxyTextI = zhongdianrenqunGxyArr[8].street;
  var gxynumberI = zhongdianrenqunGxyArr[8].numbers;
  var gxyTextJ = zhongdianrenqunGxyArr[9].street;
  var gxynumberJ = zhongdianrenqunGxyArr[9].numbers;
  var gxyTextK = zhongdianrenqunGxyArr[10].street;
  var gxynumberK = zhongdianrenqunGxyArr[10].numbers;
  var myChartGxy = echarts.init(document.getElementById("gxytbBg"));
  optionGxy = {
    series: [
      {
        name: "高血压",
        type: "pie",
        radius: "50%",
        center: ["50%", "50%"],
        data: [
          {
            value: gxynumberA,
            name: gxyTextA,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: gxynumberB,
            name: gxyTextB,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: gxynumberC,
            name: gxyTextC,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: gxynumberD,
            name: gxyTextD,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: gxynumberE,
            name: gxyTextE,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: gxynumberF,
            name: gxyTextF,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: gxynumberG,
            name: gxyTextG,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: gxynumberH,
            name: gxyTextH,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: gxynumberI,
            name: gxyTextI,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: gxynumberJ,
            name: gxyTextJ,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: gxynumberK,
            name: gxyTextK,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          // { value: xiangNumberL, name: xiangNameL },
        ],
      },
    ],
  };
  myChartGxy.setOption(optionGxy);
  window.addEventListener("resize", function () {
    myChartGxy.resize();
  });
}
//重点人群之糖尿病
function zhongdianrenqunTnb(zhongdianrenqunTnbArr) {
  console.log(zhongdianrenqunTnbArr);
  // 糖尿病
  var tnbTextA = zhongdianrenqunTnbArr[0].street;
  var tnbnumberA = zhongdianrenqunTnbArr[0].numbers;
  var tnbTextB = zhongdianrenqunTnbArr[1].street;
  var tnbnumberB = zhongdianrenqunTnbArr[1].numbers;
  var tnbTextC = zhongdianrenqunTnbArr[2].street;
  var tnbnumberC = zhongdianrenqunTnbArr[2].numbers;
  var tnbTextD = zhongdianrenqunTnbArr[3].street;
  var tnbnumberD = zhongdianrenqunTnbArr[3].numbers;
  var tnbTextE = zhongdianrenqunTnbArr[4].street;
  var tnbnumberE = zhongdianrenqunTnbArr[4].numbers;
  var tnbTextF = zhongdianrenqunTnbArr[5].street;
  var tnbnumberF = zhongdianrenqunTnbArr[5].numbers;
  var tnbTextG = zhongdianrenqunTnbArr[6].street;
  var tnbnumberG = zhongdianrenqunTnbArr[6].numbers;
  var tnbTextH = zhongdianrenqunTnbArr[7].street;
  var tnbnumberH = zhongdianrenqunTnbArr[7].numbers;
  var tnbTextI = zhongdianrenqunTnbArr[8].street;
  var tnbnumberI = zhongdianrenqunTnbArr[8].numbers;
  var tnbTextJ = zhongdianrenqunTnbArr[9].street;
  var tnbnumberJ = zhongdianrenqunTnbArr[9].numbers;
  var tnbTextK = zhongdianrenqunTnbArr[10].street;
  var tnbnumberK = zhongdianrenqunTnbArr[10].numbers;
  var myChartTnb = echarts.init(document.getElementById("tnbtbBg"));
  optionTnb = {
    series: [
      {
        name: "糖尿病",
        type: "pie",
        radius: "50%",
        center: ["50%", "50%"],
        data: [
          {
            value: tnbnumberA,
            name: tnbTextA,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: tnbnumberB,
            name: tnbTextB,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: tnbnumberC,
            name: tnbTextC,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: tnbnumberD,
            name: tnbTextD,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: tnbnumberE,
            name: tnbTextE,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: tnbnumberF,
            name: tnbTextF,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: tnbnumberG,
            name: tnbTextG,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: tnbnumberH,
            name: tnbTextH,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: tnbnumberI,
            name: tnbTextI,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: tnbnumberJ,
            name: tnbTextJ,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          {
            value: tnbnumberK,
            name: tnbTextK,
            label: {
              //引导线文字设置
              // backgroundColor: "#f00",
              // color: "#FA8072",
              formatter: "{b}:{d}%",
            },
          },
          // { value: xiangNumberL, name: xiangNameL },
        ],
        left: 0,
        right: 0,
        top: 0,
        bottom: 0,
      },
    ],
  };
  myChartTnb.setOption(optionTnb);
  window.addEventListener("resize", function () {
    myChartTnb.resize();
  });
}
